import Vue from 'vue'
import VueRouter from 'vue-router'
import test from '../views/test.vue'
Vue.use(VueRouter)

const routes = [
 {
    path:'/',
    name:'test',
    component: test
  },

  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( '../views/About.vue')
  },

  {
    path: '/newpage/:id/:category_id',
    name: 'newpage',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import( '../views/newpage.vue')
  },

  {
    path: '/shopcar',
    name: 'shopcar',
    component: () => import( '../views/shopcar.vue')
  },
  
  {
    path: '/login',
    name: 'login',
    component: () => import( '../views/login.vue')
  },

  {
    path: '/search/:value',
    name: 'serach',
    component: () => import( '../views/search.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
